--断罪
local duanzui = fk.CreateSkill {
    name = "mcdh_duanzui"
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

duanzui:addEffect(fk.AfterCardUseDeclared,{
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(self) and data.card.trueName == "slash"
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        room.logic:dumpEventStack()
        local judgeData = {
            who = player,
            reason = self.name,
            pattern = ".|2~9|spade",
        }
        room:judge(judgeData)
        local result = judgeData.card
        if result.suit == Card.Spade then
            local card = Fk:cloneCard("thunder__slash", data.card.suit, data.card.number)
            for k, v in pairs(data.card) do
                if card[k] == nil then
                    card[k] = v
                end
            end
            if data.card:isVirtual() then
                card.subcards = data.card.subcards
            else
                card.id = data.card.id
            end
            card.skillNames = data.card.skillNames
            card.skillName = self.name
            data.card = card
            data.additionalDamage = (data.additionalDamage or 0) + 1
        end
        if result.number >= 2 and result.number <= 9 then
            data.disresponsiveList = TargetGroup:getRealTargets(data.tos)
        end
    end
})

Fk:loadTranslationTable {
    ["mcdh_duanzui"] = "断罪",
    [":mcdh_duanzui"] = "『断罪』<br>当你声明使用【杀】后，你可以判定，若结果为♠，将此【杀】改为雷【杀】且伤害值+1；若结果为2~9，此【杀】不能被响应。"
}

return duanzui